.class public final La/a/hq;
.super Ljava/lang/Object;

# interfaces
.implements La/a/hx;
.implements Lcom/a/a/a/f;


# instance fields
.field private a:La/a/hz;

.field private b:La/a/ia;

.field private c:Lcom/a/a/m;

.field private d:Lcom/a/a/v;

.field private e:La/a/ie;

.field private f:La/a/gx;

.field private g:I

.field private h:Landroid/content/Context;


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 3

    const/4 v0, 0x0

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    iput-object v0, p0, La/a/hq;->a:La/a/hz;

    iput-object v0, p0, La/a/hq;->b:La/a/ia;

    iput-object v0, p0, La/a/hq;->c:Lcom/a/a/m;

    iput-object v0, p0, La/a/hq;->d:Lcom/a/a/v;

    iput-object v0, p0, La/a/hq;->e:La/a/ie;

    iput-object v0, p0, La/a/hq;->f:La/a/gx;

    const/16 v0, 0xa

    iput v0, p0, La/a/hq;->g:I

    iput-object p1, p0, La/a/hq;->h:Landroid/content/Context;

    new-instance v0, La/a/hz;

    invoke-direct {v0, p1}, La/a/hz;-><init>(Landroid/content/Context;)V

    iput-object v0, p0, La/a/hq;->a:La/a/hz;

    invoke-static {p1}, La/a/ho;->a(Landroid/content/Context;)La/a/gx;

    move-result-object v0

    iput-object v0, p0, La/a/hq;->f:La/a/gx;

    new-instance v0, La/a/ie;

    invoke-direct {v0, p1}, La/a/ie;-><init>(Landroid/content/Context;)V

    iput-object v0, p0, La/a/hq;->e:La/a/ie;

    new-instance v0, La/a/ia;

    invoke-direct {v0, p1}, La/a/ia;-><init>(Landroid/content/Context;)V

    iput-object v0, p0, La/a/hq;->b:La/a/ia;

    iget-object v0, p0, La/a/hq;->b:La/a/ia;

    iget-object v1, p0, La/a/hq;->e:La/a/ie;

    invoke-virtual {v0, v1}, La/a/ia;->a(La/a/ie;)V

    invoke-static {p1}, Lcom/a/a/v;->a(Landroid/content/Context;)Lcom/a/a/v;

    move-result-object v0

    iput-object v0, p0, La/a/hq;->d:Lcom/a/a/v;

    iget-object v0, p0, La/a/hq;->h:Landroid/content/Context;

    invoke-static {v0}, Lcom/a/a/a;->c(Landroid/content/Context;)[I

    move-result-object v0

    const/4 v1, 0x0

    aget v1, v0, v1

    const/4 v2, 0x1

    aget v0, v0, v2

    invoke-direct {p0, v1, v0}, La/a/hq;->a(II)V

    return-void
.end method

.method private a([B)La/a/ep;
    .locals 3

    const/4 v0, 0x0

    if-nez p1, :cond_0

    :goto_0
    return-object v0

    :cond_0
    :try_start_0
    new-instance v1, La/a/ep;

    invoke-direct {v1}, La/a/ep;-><init>()V

    new-instance v2, La/a/fy;

    invoke-direct {v2}, La/a/fy;-><init>()V

    invoke-virtual {v2, v1, p1}, La/a/fy;->a(La/a/ft;[B)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-object v0, v1

    goto :goto_0

    :catch_0
    move-exception v1

    invoke-virtual {v1}, Ljava/lang/Exception;->printStackTrace()V

    goto :goto_0
.end method

.method private a(II)V
    .locals 4

    packed-switch p1, :pswitch_data_0

    :pswitch_0
    new-instance v0, Lcom/a/a/i;

    invoke-direct {v0}, Lcom/a/a/i;-><init>()V

    iput-object v0, p0, La/a/hq;->c:Lcom/a/a/m;

    :goto_0
    const-string v0, "MobclickAgent"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "report policy:"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, " interval:"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, La/a/fl;->c(Ljava/lang/String;Ljava/lang/String;)V

    return-void

    :pswitch_1
    new-instance v0, Lcom/a/a/i;

    invoke-direct {v0}, Lcom/a/a/i;-><init>()V

    iput-object v0, p0, La/a/hq;->c:Lcom/a/a/m;

    goto :goto_0

    :pswitch_2
    new-instance v0, Lcom/a/a/j;

    iget-object v1, p0, La/a/hq;->e:La/a/ie;

    int-to-long v2, p2

    invoke-direct {v0, v1, v2, v3}, Lcom/a/a/j;-><init>(La/a/ie;J)V

    iput-object v0, p0, La/a/hq;->c:Lcom/a/a/m;

    goto :goto_0

    :pswitch_3
    new-instance v0, Lcom/a/a/l;

    iget-object v1, p0, La/a/hq;->e:La/a/ie;

    invoke-direct {v0, v1}, Lcom/a/a/l;-><init>(La/a/ie;)V

    iput-object v0, p0, La/a/hq;->c:Lcom/a/a/m;

    goto :goto_0

    :pswitch_4
    new-instance v0, Lcom/a/a/m;

    invoke-direct {v0}, Lcom/a/a/m;-><init>()V

    iput-object v0, p0, La/a/hq;->c:Lcom/a/a/m;

    goto :goto_0

    :pswitch_5
    new-instance v0, Lcom/a/a/n;

    iget-object v1, p0, La/a/hq;->h:Landroid/content/Context;

    invoke-direct {v0, v1}, Lcom/a/a/n;-><init>(Landroid/content/Context;)V

    iput-object v0, p0, La/a/hq;->c:Lcom/a/a/m;

    goto :goto_0

    :pswitch_6
    new-instance v0, Lcom/a/a/k;

    iget-object v1, p0, La/a/hq;->a:La/a/hz;

    invoke-direct {v0, v1, p2}, Lcom/a/a/k;-><init>(La/a/hz;I)V

    iput-object v0, p0, La/a/hq;->c:Lcom/a/a/m;

    goto :goto_0

    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_4
        :pswitch_1
        :pswitch_0
        :pswitch_0
        :pswitch_3
        :pswitch_5
        :pswitch_2
        :pswitch_6
    .end packed-switch
.end method

.method private a(Z)Z
    .locals 2

    const/4 v0, 0x1

    iget-object v1, p0, La/a/hq;->h:Landroid/content/Context;

    invoke-static {v1}, La/a/fk;->g(Landroid/content/Context;)Z

    move-result v1

    if-nez v1, :cond_2

    sget-boolean v0, La/a/fl;->a:Z

    if-eqz v0, :cond_0

    const-string v0, "MobclickAgent"

    const-string v1, "network is unavailable"

    invoke-static {v0, v1}, La/a/fl;->c(Ljava/lang/String;Ljava/lang/String;)V

    :cond_0
    const/4 v0, 0x0

    :cond_1
    :goto_0
    return v0

    :cond_2
    iget-object v1, p0, La/a/hq;->e:La/a/ie;

    invoke-virtual {v1}, La/a/ie;->a()Z

    move-result v1

    if-nez v1, :cond_1

    sget-boolean v1, La/a/fl;->a:Z

    if-eqz v1, :cond_3

    iget-object v1, p0, La/a/hq;->h:Landroid/content/Context;

    invoke-static {v1}, La/a/fk;->q(Landroid/content/Context;)Z

    move-result v1

    if-nez v1, :cond_1

    :cond_3
    iget-object v0, p0, La/a/hq;->c:Lcom/a/a/m;

    invoke-virtual {v0, p1}, Lcom/a/a/m;->a(Z)Z

    move-result v0

    goto :goto_0
.end method

.method private a(La/a/ep;)[B
    .locals 1

    :try_start_0
    new-instance v0, La/a/gb;

    invoke-direct {v0}, La/a/gb;-><init>()V

    invoke-virtual {v0, p1}, La/a/gb;->a(La/a/ft;)[B
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v0

    :goto_0
    return-object v0

    :catch_0
    move-exception v0

    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    const/4 v0, 0x0

    goto :goto_0
.end method

.method private c()Z
    .locals 2

    iget-object v0, p0, La/a/hq;->a:La/a/hz;

    invoke-virtual {v0}, La/a/hz;->a()I

    move-result v0

    iget v1, p0, La/a/hq;->g:I

    if-le v0, v1, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method private d()V
    .locals 4

    :try_start_0
    iget-object v0, p0, La/a/hq;->e:La/a/ie;

    invoke-virtual {v0}, La/a/ie;->a()Z

    move-result v0

    if-eqz v0, :cond_0

    iget-object v0, p0, La/a/hq;->a:La/a/hz;

    new-instance v1, La/a/f;

    iget-object v2, p0, La/a/hq;->e:La/a/ie;

    invoke-virtual {v2}, La/a/ie;->i()J

    move-result-wide v2

    invoke-direct {v1, v2, v3}, La/a/f;-><init>(J)V

    invoke-virtual {v0, v1}, La/a/hz;->a(La/a/f;)V

    :cond_0
    invoke-direct {p0}, La/a/hq;->e()V
    :try_end_0
    .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0

    :cond_1
    :goto_0
    return-void

    :catch_0
    move-exception v0

    instance-of v1, v0, Ljava/lang/OutOfMemoryError;

    if-eqz v1, :cond_2

    :cond_2
    if-eqz v0, :cond_1

    invoke-virtual {v0}, Ljava/lang/Throwable;->printStackTrace()V

    goto :goto_0
.end method

.method private e()V
    .locals 5

    iget-object v0, p0, La/a/hq;->h:Landroid/content/Context;

    invoke-static {v0}, Lcom/a/a/v;->a(Landroid/content/Context;)Lcom/a/a/v;

    move-result-object v1

    invoke-virtual {v1}, Lcom/a/a/v;->f()Z

    move-result v2

    if-eqz v2, :cond_1

    invoke-virtual {v1}, Lcom/a/a/v;->d()[B

    move-result-object v0

    :goto_0
    iget-object v3, p0, La/a/hq;->b:La/a/ia;

    invoke-virtual {v3, v0}, La/a/ia;->a([B)I

    move-result v3

    packed-switch v3, :pswitch_data_0

    :cond_0
    :goto_1
    return-void

    :cond_1
    iget-object v0, p0, La/a/hq;->f:La/a/gx;

    invoke-virtual {v0}, La/a/gx;->a()V

    invoke-virtual {p0}, La/a/hq;->b()[B

    move-result-object v0

    if-nez v0, :cond_2

    const-string v0, "MobclickAgent"

    const-string v1, "message is null"

    invoke-static {v0, v1}, La/a/fl;->d(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_1

    :cond_2
    iget-object v3, p0, La/a/hq;->h:Landroid/content/Context;

    iget-object v4, p0, La/a/hq;->h:Landroid/content/Context;

    invoke-static {v4}, Lcom/a/a/a;->a(Landroid/content/Context;)Ljava/lang/String;

    move-result-object v4

    invoke-static {v3, v4, v0}, La/a/fu;->a(Landroid/content/Context;Ljava/lang/String;[B)La/a/fu;

    move-result-object v0

    invoke-virtual {v0}, La/a/fu;->c()[B

    move-result-object v0

    invoke-virtual {v1}, Lcom/a/a/v;->c()V

    goto :goto_0

    :pswitch_0
    iget-object v0, p0, La/a/hq;->e:La/a/ie;

    invoke-virtual {v0}, La/a/ie;->h()Z

    move-result v0

    if-eqz v0, :cond_3

    iget-object v0, p0, La/a/hq;->e:La/a/ie;

    invoke-virtual {v0}, La/a/ie;->g()V

    :cond_3
    iget-object v0, p0, La/a/hq;->f:La/a/gx;

    invoke-virtual {v0}, La/a/gx;->c()V

    iget-object v0, p0, La/a/hq;->e:La/a/ie;

    invoke-virtual {v0}, La/a/ie;->f()V

    if-eqz v2, :cond_0

    invoke-virtual {v1}, Lcom/a/a/v;->e()V

    goto :goto_1

    :pswitch_1
    iget-object v0, p0, La/a/hq;->e:La/a/ie;

    invoke-virtual {v0}, La/a/ie;->f()V

    if-eqz v2, :cond_0

    invoke-virtual {v1}, Lcom/a/a/v;->e()V

    goto :goto_1

    :pswitch_2
    if-nez v2, :cond_4

    invoke-virtual {v1, v0}, Lcom/a/a/v;->b([B)V

    :cond_4
    const-string v0, "MobclickAgent"

    const-string v1, "connection error"

    invoke-static {v0, v1}, La/a/fl;->b(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_1

    :pswitch_data_0
    .packed-switch 0x1
        :pswitch_2
        :pswitch_0
        :pswitch_1
    .end packed-switch
.end method


# virtual methods
.method public a()V
    .locals 2

    iget-object v0, p0, La/a/hq;->a:La/a/hz;

    invoke-virtual {v0}, La/a/hz;->a()I

    move-result v0

    if-lez v0, :cond_0

    :try_start_0
    invoke-virtual {p0}, La/a/hq;->b()[B

    move-result-object v0

    if-eqz v0, :cond_0

    iget-object v1, p0, La/a/hq;->d:Lcom/a/a/v;

    invoke-virtual {v1, v0}, Lcom/a/a/v;->a([B)V
    :try_end_0
    .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0

    :cond_0
    :goto_0
    return-void

    :catch_0
    move-exception v0

    instance-of v1, v0, Ljava/lang/OutOfMemoryError;

    if-eqz v1, :cond_1

    iget-object v1, p0, La/a/hq;->d:Lcom/a/a/v;

    invoke-virtual {v1}, Lcom/a/a/v;->c()V

    :cond_1
    if-eqz v0, :cond_0

    invoke-virtual {v0}, Ljava/lang/Throwable;->printStackTrace()V

    goto :goto_0
.end method

.method public a(IJ)V
    .locals 1

    long-to-int v0, p2

    invoke-static {p1, v0}, Lcom/a/a/a;->a(II)V

    long-to-int v0, p2

    invoke-direct {p0, p1, v0}, La/a/hq;->a(II)V

    return-void
.end method

.method public a(La/a/hy;)V
    .locals 1

    if-eqz p1, :cond_0

    iget-object v0, p0, La/a/hq;->a:La/a/hz;

    invoke-virtual {v0, p1}, La/a/hz;->a(La/a/hy;)V

    :cond_0
    instance-of v0, p1, La/a/eb;

    invoke-direct {p0, v0}, La/a/hq;->a(Z)Z

    move-result v0

    if-eqz v0, :cond_2

    invoke-direct {p0}, La/a/hq;->d()V

    :cond_1
    :goto_0
    return-void

    :cond_2
    invoke-direct {p0}, La/a/hq;->c()Z

    move-result v0

    if-eqz v0, :cond_1

    invoke-virtual {p0}, La/a/hq;->a()V

    goto :goto_0
.end method

.method public b(La/a/hy;)V
    .locals 1

    iget-object v0, p0, La/a/hq;->a:La/a/hz;

    invoke-virtual {v0, p1}, La/a/hz;->a(La/a/hy;)V

    return-void
.end method

.method protected b()[B
    .locals 5

    const/4 v2, 0x0

    :try_start_0
    iget-object v0, p0, La/a/hq;->h:Landroid/content/Context;

    invoke-static {v0}, Lcom/a/a/a;->a(Landroid/content/Context;)Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v0

    if-eqz v0, :cond_1

    const-string v0, "MobclickAgent"

    const-string v1, "Appkey is missing ,Please check AndroidManifest.xml"

    invoke-static {v0, v1}, La/a/fl;->b(Ljava/lang/String;Ljava/lang/String;)V

    move-object v0, v2

    :cond_0
    :goto_0
    return-object v0

    :cond_1
    iget-object v0, p0, La/a/hq;->h:Landroid/content/Context;

    invoke-static {v0}, Lcom/a/a/v;->a(Landroid/content/Context;)Lcom/a/a/v;

    move-result-object v0

    invoke-virtual {v0}, Lcom/a/a/v;->b()[B

    move-result-object v0

    if-nez v0, :cond_2

    move-object v0, v2

    :goto_1
    if-nez v0, :cond_3

    iget-object v1, p0, La/a/hq;->a:La/a/hz;

    invoke-virtual {v1}, La/a/hz;->a()I

    move-result v1

    if-nez v1, :cond_3

    move-object v0, v2

    goto :goto_0

    :cond_2
    invoke-direct {p0, v0}, La/a/hq;->a([B)La/a/ep;

    move-result-object v0

    goto :goto_1

    :cond_3
    if-nez v0, :cond_7

    new-instance v0, La/a/ep;

    invoke-direct {v0}, La/a/ep;-><init>()V

    move-object v3, v0

    :goto_2
    iget-object v0, p0, La/a/hq;->a:La/a/hz;

    invoke-virtual {v0, v3}, La/a/hz;->a(La/a/ep;)V

    sget-boolean v0, La/a/fl;->a:Z

    if-eqz v0, :cond_5

    invoke-virtual {v3}, La/a/ep;->f()Z

    move-result v0

    if-eqz v0, :cond_5

    const/4 v1, 0x0

    invoke-virtual {v3}, La/a/ep;->e()Ljava/util/List;

    move-result-object v0

    invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v4

    :goto_3
    invoke-interface {v4}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_4

    invoke-interface {v4}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, La/a/eb;

    invoke-virtual {v0}, La/a/eb;->d()I

    move-result v0

    if-lez v0, :cond_6

    const/4 v0, 0x1

    :goto_4
    move v1, v0

    goto :goto_3

    :cond_4
    if-nez v1, :cond_5

    const-string v0, "MobclickAgent"

    const-string v1, "missing Activities or PageViews"

    invoke-static {v0, v1}, La/a/fl;->d(Ljava/lang/String;Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1

    :cond_5
    :try_start_1
    invoke-direct {p0, v3}, La/a/hq;->a(La/a/ep;)[B
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_2

    move-result-object v0

    :try_start_2
    sget-boolean v1, La/a/fl;->a:Z

    if-eqz v1, :cond_0

    const-string v1, "MobclickAgent"

    invoke-virtual {v3}, La/a/ep;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-static {v1, v3}, La/a/fl;->c(Ljava/lang/String;Ljava/lang/String;)V
    :try_end_2
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_0

    goto :goto_0

    :catch_0
    move-exception v1

    :goto_5
    :try_start_3
    const-string v1, "MobclickAgent"

    const-string v3, "Fail to serialize log ..."

    invoke-static {v1, v3}, La/a/fl;->b(Ljava/lang/String;Ljava/lang/String;)V
    :try_end_3
    .catch Ljava/lang/Exception; {:try_start_3 .. :try_end_3} :catch_1

    goto :goto_0

    :catch_1
    move-exception v0

    const-string v1, "MobclickAgent"

    const-string v3, "Fail to construct message ..."

    invoke-static {v1, v3, v0}, La/a/fl;->b(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Exception;)V

    iget-object v0, p0, La/a/hq;->h:Landroid/content/Context;

    invoke-static {v0}, Lcom/a/a/v;->a(Landroid/content/Context;)Lcom/a/a/v;

    move-result-object v0

    invoke-virtual {v0}, Lcom/a/a/v;->c()V

    move-object v0, v2

    goto/16 :goto_0

    :catch_2
    move-exception v0

    move-object v0, v2

    goto :goto_5

    :cond_6
    move v0, v1

    goto :goto_4

    :cond_7
    move-object v3, v0

    goto :goto_2
.end method
